import http from '../util/http.js'

const signInUrl = '/product/queryByAccountAndPassword'
const queryAllUrl = '/product/queryAll'
const removeByIdUrl = '/product/removeById'
const queryByAccountUrl = '/product/queryByAccount'
const createUrl = '/product/create'
const queryByIdUrl = '/product/queryById'
const queryByIdUrls = '/product/queryBySid'
const modifyUrl = '/product/modify'
const queryByFirstUrl = '/product/queryByFirst'
const queryBySecondUrl = '/product/queryBySecond'
const queryByThirdUrl = '/product/queryByThird'
const queryByTitleUrl = '/product/queryByTitle'


const signIn = (data) => {
    return http.post(signInUrl, data)
}

const queryAll = (data) => {
    return http.get(queryAllUrl, data)
}

const removeById = (data) => {
    return http.del(removeByIdUrl, data)
}

const queryByAccount = (data) => {
    return http.post(queryByAccountUrl, data)
}

const create = (data) => {
    return http.post(createUrl, data, 'multipart/form-data')
}

const queryById = (data) => {
    return http.get(queryByIdUrl, data)
}
// const queryBySid = (data) => {
//     return http.get(queryByIdUrls,data)
// }
const queryBySid = () => {
    return http.get(queryByIdUrls)
}
const modify = (data) => {
    return http.put(modifyUrl, data, 'multipart/form-data')
}

const queryByFirst = (data) =>{
    return http.get(queryByFirstUrl,data)
}

const queryBySecond = (data) =>{
    return http.get(queryBySecondUrl,data)
}

const queryByThird = (data) =>{
    return http.get(queryByThirdUrl,data)
}

const queryByTitle = (data) =>{
    return http.get(queryByTitleUrl,data)
}

export default {
    signIn, queryAll, removeById, queryByAccount, create, queryById,
    modify,queryBySid,queryByFirst,queryBySecond,queryByThird,queryByTitle
}